package com.wf.service;

import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.delegate.JavaDelegate;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.Map;

/**
 * @author mpk
 * @since 2024/8/25 18:41:27
 */
@Slf4j
@Service
public class SendFailEmailService implements JavaDelegate {

    public void execute(DelegateExecution execution) {
        Map<String, Object> variables = execution.getVariables();
        log.info("variables:{}", variables);
        variables.put("recipient", "2323741953@qq.com");
        variables.put("subject", "审核失败！！");
        variables.put("male", true);
        variables.put("now", LocalDateTime.now());
        execution.setVariables(variables);
        log.info("流程失败，发送邮件通知");
    }
}
